package com.tt.vtg.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RefreshScope
public class TestGetFromConfigService {
	@Value("${msg: default value}")
	private String msg;
	
	@Autowired
	private Environment env;
	
	@RequestMapping("/msg")
	public String getMsg(){
		return msg;
	}
	
	@RequestMapping("/msgChanged")
	public String getChangedMsg(){
		return env.getProperty("msg"); 
	}
}
